import { apiConfig, customApiConfig } from "@/config/apiConfig";
import { service, customService } from "@/config/request";

const appointment = {
  /**
   * 添加预约
   * @param {object} data
   * @param {string} data.userName 预约人姓名
   * @param {string} data.userIdCard 预约人身份证
   * @param {string} data.userPhone 预约人手机号
   * @param {string} data.userCompany 预约人单位
   * @param {string} data.professorId 预约专家
   * @param {string} data.appointmentTime 预约时间
   * @param {string} data.appointmentContent 到访事项
   * @returns 
   */
  addAppointment: (data) => customService.post(customApiConfig.appointment.addAppointment, data),
  /**
   * 获取预约列表
   * @param {object} data
   * @param {number} data.pageNum 页码
   * @param {number} data.pageSize 页面大小
   * @returns 
   */
  getAppointmentList: (data) => customService.post(customApiConfig.appointment.getAppointmentList, data),
  /**
   * 获取预约详情
   * @param {object} data
   * @param {string} data.id 预约id
   * @returns 
   */
  getAppointmentDetail: (data) => customService.post(customApiConfig.appointment.getAppointmentDetail, data),
  /**
   * 专家审核预约
   * @param {object} data 
   * @param {string} data.id 预约id
   * @param {string} data.status 审核状态 1:通过 2:不通过
   * @returns 
   */
  updateAppointment: (data) => customService.post(customApiConfig.appointment.updateAppointment, data),
};

export default appointment;